package com.github.ecbp.user.service.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.ecbp.common.data.service.BaseService;
import com.github.ecbp.common.req.BaseIdDTO;
import com.github.ecbp.user.service.dto.ButtonBo;
import com.github.ecbp.user.service.dto.MenuBo;
import com.github.ecbp.user.service.dto.MenuDto;
import com.github.ecbp.user.service.dto.MenuQueryDto;
import com.github.ecbp.user.service.entity.TMenu;
import com.github.ecbp.user.service.response.MenuRes;
import com.github.ecbp.user.service.vo.ButtonNode;
import com.github.ecbp.user.service.vo.MenuNode;
import com.github.ecbp.user.service.vo.MenuPageVo;

import java.util.List;

/**
 * <p>
 * 后台菜单表 服务类
 * </p>
 *
 * @author zj2626
 * @since 2020-03-18
 */
public interface MenuService extends BaseService<TMenu> {

    /**
     * 保存
     *
     * @param param
     * @return boolean
     * @author zj2626
     * @date 2020/5/12
     */
    boolean create(MenuDto param);

    IPage<MenuPageVo> page(MenuQueryDto param);

    int updateSelectiveById(MenuDto param);

    boolean removeMenuById(BaseIdDTO param);

    /**
     * 返回树状菜单
     *
     * @param menuBo
     * @return java.util.List<com.ecbp.service.user.vo.MenuNode>
     * @author zj2626
     * @date 2020/5/12
     */
    List<MenuNode> treeList(MenuBo menuBo);

    /**
     * 通过用户ID获取菜单
     *
     * @param adminId
     * @return java.util.List<com.ecbp.service.user.entity.TMenu>
     * @author zj2626
     * @date 2020/5/12
     */
    List<TMenu> getMenuList(Long adminId);

    /**
     * 返回菜单下按钮
     *
     * @param buttonBo
     * @return java.util.List<com.ecbp.service.user.vo.ButtonNode>
     * @author zj2626
     * @date 2020/5/12
     */
    List<ButtonNode> buttonList(ButtonBo buttonBo);

    MenuRes getById(Long id);

    /**
     * 重新加载缓存中的用户权限
     *
     * @param id
     * @return void
     * @author zj2626
     * @date 2020/5/12
     */
    void reloadUserPermission(Long id);
}
